<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>main—mine</title>
		<!-- css代码 start -->
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link href="../../css/global.css" rel="stylesheet" />
		<link href="../../css/mine.css" rel="stylesheet" />
		<link href="../../css/style.css" rel="stylesheet" />
		<link href="../../css/task.css" rel="stylesheet" />
		<style>
			#div {
				width: 0px;
				height: 0px;
				background: red;
				position: fixed;
				top: 70%;
				left: 50%;
			}
					
			/*移除底部或顶部三角,需要在删除此代码*/
			.mui-popover .mui-popover-arrow:after {
				width: 0px;
			}
		</style>
		<!-- css代码 end -->
	</head>
	<body>

		<div id="div"></div>
		<div id="popover" class="mui-popover shadow popover">
		 <p class="title" id="title">您确定要退出吗？</p >
		 <div class="btn_box">
		  
		  <span class="fl" onclick="closePopover()">取消</span>
		  <span class="fr red" onclick="fixedBackLogin()">确定</span>
		 </div>
		</div>

		<!-- html代码 start -->
		<div class="send_logo">
			<img src="../../images/send_logo.png" width="100%"  style="pointer-events:none;">
		</div>
		<div class="mui-content m">
			<div class="my-head autoHeight">
				<!--<img src="" alt="" />-->
				<div class="my_photo" id="my_photo">
					<img src="../../images/head.png" />
				</div>
				<div class="my-head-font">
					<p class="my-name" id="name"></p>
					<p class="my-phone" id="juse"></p>
				</div>
				<!-- <p class="my-head-btn">休假</p> -->
			</div>
			<div class="my-content">
				<!-- 问题反馈 功能暂时关闭 20200624 -->
				<!-- <div class="my-content-cell">
					<div class="inline-block my-icon1" id="wtfk">
						<em>问题反馈</em>
						<span class="mui-icon mui-icon-arrowright arrow-right-position"></span>
					</div>
				</div> -->
				<div class="my-content-cell">
					<div class="inline-block my-icon2" id="sysm">
						<em>使用说明</em>
						<span class="mui-icon mui-icon-arrowright arrow-right-position"></span>
					</div>
				</div>
				<div class="my-content-cell">
					<div class="inline-block  my-icon3" id="gyrj">
						<em>关于软件</em>
						<span class="mui-icon mui-icon-arrowright arrow-right-position"></span>
					</div>
				</div>
				<div class="my-content-cell">
					<div class="inline-block my-icon4" id="rjgx">
						<em>软件更新</em>
						<span class="mui-icon mui-icon-arrowright arrow-right-position"></span>
					</div>
				</div>
			</div>
			<div class="my-commit">
				<div id="back" class="my-button">退出</div>
			</div>
		</div>
		<!-- html代码 end -->

		<!-- js代码 start -->

		<!-- 基础js start -->
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/utils/h.js"></script>
		<script src="../../js/constant.js"></script>
		<script src="../../js/common.js"></script>
		<script src="../../js/utils/base64.js"></script>
		<script src="../../js/utils/md5.js"></script>
		<script src="../../js/utils/sortMap.js"></script>
		<script src="../../js/utils/http.js"></script>
		<script src="../../js/app.js"></script>
		<!-- 基础js end -->
		<script src="../../js/utils/jpush.js"></script>
		<script src="../../js/JPushTools.js"></script>
		<script type="text/javascript" charset="utf-8">
			/**
			 * 版本检查更新
			 */
			function checkAppVersion() {
				var currentType = plus.networkinfo.getCurrentType()
				if (currentType === plus.networkinfo.CONNECTION_NONE || currentType === plus.networkinfo.CONNECTION_UNKNOW) {
					plus.nativeUI.closeWaiting()
					plus.nativeUI.closeToast()
					plus.nativeUI.toast("当前无网络")
					return;
				}
				app.showWaiting("检查中...")
				ajaxGetNoneToken(BASE_URL + 'cc/app/latestApp', {}, function(data) {
					// console.log(JSON.stringify(data))
					app.closeWaiting()
					if (data.code === 200) {
						var versionCode = data.data.versionCode;
						if (versionCode > plus.runtime.versionCode) {
							appUpdate(data.data.versionDesc, data.data.appUrl)
						} else {
							app.toast("已是最新版本")
						}
					} else {
						app.toast(data.msg)
					}
				}, function(error) {
					app.closeWaiting()
					app.toast(error)
				});
			}
			
			function fixedBackLogin(){
				mui("#popover").popover('toggle', document.getElementById("div"));
				app.backLogin();
			}
			
			function closePopover() {
				mui("#popover").popover('hide', document.getElementById("div"));
			}
			
			/**
			 * app更新提示框
			 * 
			 * @param {Object} desc
			 * @param {Object} url 
			 */
			function appUpdate(desc, url) {
				plus.nativeUI.alert(desc, function(){
						plus.runtime.openURL(url)
				}, "更新提示", "更新");
			}
			
			(function($, doc) {
				$.init();

				$.plusReady(function() {
					// console.log(JSON.stringify(app.getUser()))
					var name = app.getUser().name;
					var position = app.getUser().position;
					h("#name").html(name);
					h("#juse").html(position);
					
					h("#back").tap(function() {
						mui("#popover").popover('toggle', document.getElementById("div"));						
					});
					
					// 使用说明
					h("#sysm").tap(function(){
						app.jumpTo("/view/mine/instructions.html", "view/mine/instructions.html",
						null);
					})
					
					// 关于软件
					h("#gyrj").tap(function(){
						app.jumpTo("/view/mine/aboutSoftware.html", "view/mine/aboutSoftware.html",
						null);
					})
					
					// 问题反馈
					h("#wtfk").tap(function(){
						app.jumpTo("/view/mine/feedback.html", "view/mine/feedback.html",
						null);
					})
					
					// 软件更新
					h('#rjgx').tap(function(){
						checkAppVersion()
					})
					
				});
			}(mui, document));
		</script>
		<!-- js代码 end -->
	</body>
</html>
